#ifndef VERTEX_H
#define VERTEX_H

#include "vector3d.h"

#include <QObject>

/** 王诗阳三维点对象 WSY 20201207 */
class Vertex3D : public QObject
{
    Q_OBJECT
public:
    Vertex3D(double x, double y, double z) {
        this->setValues(x, y, z);
    }
    ~Vertex3D() {

    }
    virtual void setValues(double x, double y, double z) {
        this->x = x; this->y = y; this->z = z;
    }
    virtual double getX() {
        return this->x;
    }
    virtual double getY() {
        return this->y;
    }
    virtual double getZ() {
        return this->z;
    }
    Vertex3D *addVectors(Vector3D *vector) {
        return new Vertex3D(
                    this->x + vector->getDeltaX(),
                    this->y + vector->getDeltaY(),
                    this->z + vector->getDeltaZ());
    }
    virtual void printSinglePoint(QString text)
    {
        qDebug() << text <<
                    ":\nx: " << this->x <<
                    "\ny: " << this->y <<
                    "\nz: " << this->z;
    }
    virtual Vertex3D *clone() {
        return new Vertex3D(x, y, z);
    }
private:
    double x, y, z;
};

#endif // VERTEX_H
